/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataLayer;

import Objects.Game;
import java.sql.Blob;
import java.util.ArrayList;

/**
 *
 * @author zorr
 */
public class DataLayerInterfaceHandler implements DataLayerInterface {

    private static DataLayerInterfaceHandler instance;
    
    private DataLayerInterfaceHandler () {}
    
    public static DataLayerInterfaceHandler getInstance () {
        if (DataLayerInterfaceHandler.instance == null) {
            DataLayerInterfaceHandler.instance = new DataLayerInterfaceHandler();
        }
        return DataLayerInterfaceHandler.instance;
    }
    
    @Override
    public ArrayList<Game> getGameList(String username, String pwd) {
        return DatabaseConnection.getGameList(username, pwd);
    }


    public String buyGame(String username, int gameId) {
        return DatabaseConnection.buyGame(username, gameId);
    }

    @Override
    public ArrayList<Game> getMyGames(String username) {
        return DatabaseConnection.getMyGames(username);
    }

    @Override
    public Blob getLicense(String username, int gameId) {
        return DatabaseConnection.getLicense(username, gameId);
    }

    @Override
    public Blob getGame(int gameId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Blob getSymKey(String user, int gameId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean insertLicense(int contentid_fk, String username_fk, byte[] encsymkey, byte[] symkey) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Blob getCertByUserName(String username) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
